package com.orangelife.other;

import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.orangelife.exception.AppBizException;
import com.orangelife.utils.HttpSvcUtils;
import com.orangelife.utils.ProConfig;



public class OtherService {

	private static String serviceHost = "http://10.168.7.64:8080/payMent_api";
	private static String serviceHost2 = "http://10.168.7.64:8080/message_api";
	public static final String appID = "c41007de-f3e0-49df-a67b-721995106be8";
	static {
		
		
		serviceHost=ProConfig.getProValues("payMentUrl");
		serviceHost2=ProConfig.getProValues("messageUrl");
	}
	
	
	
	public static JSONObject sendMsg(Map data) throws AppBizException {
		String url = serviceHost2 + "/app/orangelife/service/sms/groupSend";

		JSONObject	jj =HttpSvcUtils.doPostSvc(url, data, null);
		if(jj==null){
			
			return null;
		}
		String errCode = jj.get("errCode") + "";
		String errInfo = jj.get("errInfo") + "";
		if (!"0".equals(errCode)) {
			
						throw new AppBizException(98, errInfo);
					}
		
		return jj;
	}
	
	
	public static JSONObject addPayOrder(Map data) throws AppBizException {
		String url = serviceHost + "/app/payMent/service/v1.0.0/payOrder/add";

		JSONObject	jj =HttpSvcUtils.doPostSvc(url, data, null);
		if(jj==null){
			
			return null;
		}
		String errCode = jj.get("errCode") + "";
		String errInfo = jj.get("errInfo") + "";
		if (!"0".equals(errCode)) {
			
						throw new AppBizException(98, errInfo);
					}
		
		return jj;
	}



}
